package lanqiao;

import java.util.Scanner;

public class 杨辉三角 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[][] arr = new int[n + 1][n + 1];
        if (n == 1) {
            System.out.println(1);
        } else {
            for (int i = 0; i < arr.length; i++) {
                arr[i][0] = 1;
                arr[i][i] = 1;
            }

            int cur = 0;
            long count = 0;
            boolean flag = false;
            for (int i = 1; i < arr.length; i++) {
                if (!flag) {
                    for (int j = 1; j < i; j++) {
                        arr[i][j] = arr[i - 1][j] + arr[i - 1][j - 1];
                        if (arr[i][j] != n) {
                            count++;
                        } else {
                            cur = i;
                            flag = true;
                            break;
                        }
                    }
                } else break;
            }
            System.out.println(cur * 2 + 1 + count);
        }
    }
}
